#encoding:utf-8

class ApiErrExcept(Exception):
    def __init__(self,proxy,apiCode,apiMsg):
        super(ApiErrExcept, self).__init__(proxy,apiCode,apiMsg)
        self.proxy=proxy
        self.apiCode=apiCode
        self.apiMsg=apiMsg

    def __str__(self):
        descDict = self.__dict__
        return """ApiExcept-----{desc}""".format(
            desc=",".join(
                ["{key}:{val}".format(key=key, val=val.encode("utf-8") if isinstance(val, unicode) else val) for
                 key, val in descDict.items()])
        )

class ErrMsgExcept(Exception):
    def __init__(self,msg):
        super(ErrMsgExcept, self).__init__(msg)
        self.msg=msg